home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / New System Software Extensions / OpenDoc A6 / OpenDoc Parts Framework / OPF / Examples / Text / Textension / Include / GraphicsRun.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-04-21  |  2.3 KB  |  99 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        GraphicsRun.h
  3.  
  4.     Contains:    xxx put contents here xxx
  5.  
  6.     Written by:    Essam Zaky
  7.  
  8.     Copyright:    © 1994 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.          <2>      1/4/94    EZ        clean up
  13.          <1>      1/4/94    EZ        first checked in
  14.  
  15. */
  16.  
  17. #ifndef _GraphicsRun_
  18. #define _GraphicsRun_
  19.  
  20. #ifndef _ToolBoxDump_
  21. #include "ToolBoxDump.h"
  22. #endif
  23.  
  24. #ifndef _TextensionCommon_
  25. #include "TextensionCommon.h"
  26. #endif
  27.  
  28. #ifndef _RunObject_
  29. #include "RunObject.h"
  30. #endif
  31.  
  32. //***************************************************************************************************
  33.  
  34.  
  35. class    CGraphicsRun    :    public CRunObject {
  36.     public:
  37. //-------
  38.     CGraphicsRun();
  39.     
  40.     inline void    IGraphicsRun() {this->IRunObject();}
  41.  
  42.     //•override
  43.     virtual CAttrObject* CreateNew() const = 0;
  44.  
  45.     virtual ClassId GetClassId() const = 0;
  46.     
  47.     Boolean IsTextRun() const;
  48.     
  49.     virtual TObjFlags GetObjFlags();
  50.     
  51.     //DoPixel2Char and DoChar2Pixel will never be called since kIndivisibleRun is returned, but they are pure virtual fns
  52.     virtual void DoPixel2Char(Pixel2CharPb* paramPb);
  53.     virtual short DoChar2Pixel(Char2PixelPb* paramPb);
  54.  
  55.     virtual Fixed DoMeasure(MeasurePb* paramPb);
  56.     virtual StyledLineBreakCode DoBreak(LineBreakPb* paramPb);
  57.     virtual void DoDrawJust(DrawJustPb* paramPb);
  58.  
  59.     virtual void SetHilite(char oldHilite, char newHilite, const RunPositionPB* paramPb, Boolean doDraw = true);
  60.     //paramPb is defined <==> doDraw == true
  61.  
  62.     virtual void DrawSelection(char hiliteStat, const RunPositionPB* paramPb);
  63.     
  64.     virtual void SetCursor(Point, const RunPositionPB*) const; //set it to arrow
  65.     
  66.     protected:
  67. //----------
  68.     //•override
  69.     virtual void CalcHiteInfo(short* ascent, short* descent, short* leading);
  70.     
  71.     //•own
  72.     virtual Boolean GetDimensions(short* hite, short* width) = 0;
  73.     //returns the non scaled dimensions
  74.  
  75. #ifdef txtnScal
  76.     void GetScaledDimensions(short* hite, short* width
  77.                                                         , const Point* numer=nil, const Point* denom=nil);
  78. #else
  79.     void GetScaledDimensions(short* hite, short* width);
  80. #endif
  81.  
  82.     virtual void Draw(const Rect* theRect) = 0;
  83.     
  84.     void GetObjectRect(const RunPositionPB* paramPb, Rect* objRect);
  85.     
  86.     private:
  87. //--------
  88. short fExtraWidth;
  89.  
  90. #ifdef txtnScal
  91.     void AdjustObjRect(Rect* objRect, Point numer, Point denom);
  92. #else
  93.     void AdjustObjRect(Rect* objRect);
  94. #endif
  95. };
  96. //***************************************************************************************************
  97.  
  98. #endif
  99.